//
//  MinePostItemFrame.m
//  JiaoX
//
//  Created by yinqy on 15/3/20.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import "MinePostItemFrame.h"

@implementation MinePostItemFrame


-(void)setInteract:(MineInteract *)interact{
    _interact = interact;
    
    CGSize namesize = [interact.postsTitle sizeWithFont:NAME_FONT constrainedToSize:CGSizeMake(JXScreenW-20, MAXFLOAT)];
    self.nameFrame = (CGRect){{10,15},namesize};
    
    CGFloat timeX = 10;
    CGFloat timeY = CGRectGetMaxY(self.nameFrame)+10;
    CGSize timesize = [interact.createTime sizeWithFont:TIME_FONT];
    self.timeBtnFrame = (CGRect){{timeX,timeY},{timesize.width+30,timesize.height}};
    
    
    CGSize arrowSize = [UIImage imageNamed:@"self_item_arrow"].size;
    self.arrowFrame = CGRectMake(JXScreenW-arrowSize.width-10, timeY, arrowSize.width, arrowSize.height);
    
    self.statusFrame = CGRectMake(JXScreenW/2, CGRectGetMaxY(self.nameFrame)+10, JXScreenW/2-17-arrowSize.width, TIME_FONT.lineHeight);
    
    if (![Utils isBlankString:interact.season]) {
        self.reasonFrame = CGRectMake(timeX, CGRectGetMaxY(self.timeBtnFrame)+10, JXScreenW-20, SEASON_FONT.lineHeight);
    }else{
        self.reasonFrame = CGRectMake(timeX, CGRectGetMaxY(self.timeBtnFrame), 0, 0);
    }
    self.frame = CGRectMake(0, 0, JXScreenW, CGRectGetMaxY(self.reasonFrame)+15);
}

@end
